using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using CameraNames = Enums.CameraNames;

public class CameraManager
{
    Dictionary<CameraNames, Camera> m_cameraCollection;

    #region Instance
    private CameraManager m_instance;
    private CameraManager() { }
    public CameraManager Instance
    {
        get
        {
            if (m_instance == null)
            {
                m_instance = new CameraManager();
                return m_instance;
            }
            return m_instance;
        }
    }
    #endregion

    public void Initalize()
    {
        m_cameraCollection = new Dictionary<CameraNames, Camera>();
    }

    public void AddCamera(CameraNames name, Camera cam)
    {
            if (!m_cameraCollection.ContainsKey(name))
                m_cameraCollection.Add(name, cam);
            else
            Debug.LogError("Can't add camera " + name);
    }

    public void RemoveCamera(CameraNames name)
    {
        if (m_cameraCollection.ContainsKey(name))
            m_cameraCollection.Remove(name);
        else
            Debug.LogError("Can't remove camera: " + name);
    }

    public void ShutDown()
    {
        m_cameraCollection.Clear();
        m_cameraCollection = null;
    }
}
